/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.eps.modelo.javabeans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author luis
 */
@Entity
@Table(name = "T_Consumo")
@NamedQueries({
    @NamedQuery(name = "Consumo.findAll", query = "SELECT c FROM Consumo c"),
    @NamedQuery(name = "Consumo.findByConsumo", query = "SELECT c FROM Consumo c WHERE c.consumo = :consumo"),
    @NamedQuery(name = "Consumo.findByAtipico", query = "SELECT c FROM Consumo c WHERE c.atipico = :atipico"),
    @NamedQuery(name = "Consumo.findByNumeroInscripcion", query = "SELECT c FROM Consumo c WHERE c.numeroInscripcion = :numeroInscripcion"),
    @NamedQuery(name = "Consumo.findByTConsumoID", query = "SELECT c FROM Consumo c WHERE c.tConsumoID = :tConsumoID")})
public class Consumo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @Column(name = "consumo")
    private int consumo;
    @Basic(optional = false)
    @Column(name = "atipico")
    private short atipico;
    @Basic(optional = false)
    @Column(name = "numeroInscripcion")
    private String numeroInscripcion;
    @Id
    @Basic(optional = false)
    @Column(name = "T_Consumo_ID")
    private Integer tConsumoID;
    @JoinColumns({
        @JoinColumn(name = "T_CicloMedicion_ID", referencedColumnName = "T_CicloMedicion_ID"),
        @JoinColumn(name = "correlativo", referencedColumnName = "correlativo")})
    @ManyToOne(optional = false)
    private PadronLectura padronLectura;

    public Consumo() {
    }

    public Consumo(Integer tConsumoID) {
        this.tConsumoID = tConsumoID;
    }

    public Consumo(Integer tConsumoID, int consumo, short atipico, String numeroInscripcion) {
        this.tConsumoID = tConsumoID;
        this.consumo = consumo;
        this.atipico = atipico;
        this.numeroInscripcion = numeroInscripcion;
    }

    public int getConsumo() {
        return consumo;
    }

    public void setConsumo(int consumo) {
        this.consumo = consumo;
    }

    public short getAtipico() {
        return atipico;
    }

    public void setAtipico(short atipico) {
        this.atipico = atipico;
    }

    public String getNumeroInscripcion() {
        return numeroInscripcion;
    }

    public void setNumeroInscripcion(String numeroInscripcion) {
        this.numeroInscripcion = numeroInscripcion;
    }

    public Integer getTConsumoID() {
        return tConsumoID;
    }

    public void setTConsumoID(Integer tConsumoID) {
        this.tConsumoID = tConsumoID;
    }

    public PadronLectura getPadronLectura() {
        return padronLectura;
    }

    public void setPadronLectura(PadronLectura padronLectura) {
        this.padronLectura = padronLectura;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tConsumoID != null ? tConsumoID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Consumo)) {
            return false;
        }
        Consumo other = (Consumo) object;
        if ((this.tConsumoID == null && other.tConsumoID != null) || (this.tConsumoID != null && !this.tConsumoID.equals(other.tConsumoID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "murguia.ejb30.entity.COMER.Consumo[tConsumoID=" + tConsumoID + "]";
    }

}
